from django.db import models
class Class(models.Model):
    id=models.AutoField(primary_key=True)
    name=models.CharField(max_length=10)

class Student(models.Model):
    id=models.AutoField(primary_key=True)
    name=models.CharField(max_length=10)
    sex=models.IntegerField()
    class_id=models.ForeignKey(to='Class',on_delete=models.SET_NULL,null=True)
    # class Mate:

    # 创建表时  对表进行命名
    #     db_table='sssss'
